#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{

	int a[5][3];
	int i = 0;
	int k = 0;
	int count = 0;
	for (i = 0; i < 5; i++)
	{
		int j = 0;
		for (j = 0; j < 3; j++)
		{
			scanf("%d", &a[i][j]);
		}
	}
	for (i = 0; i < 5; i++)
	{
		int j = 0;
		for (j = 0; j < 3; j++)
		{
			if (a[i][j] % k == 0)
			{
				count++;
			}
		}
	}
	printf("%d", count);
	return 0;
}

